package com.ruitu.health.adapter;

import com.ruitu.health.fragment.HomePro2Fragment;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

// 首页tab模块adapter
public class TabVpAdapter extends FragmentPagerAdapter {
    public TabVpAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        if (position == 1) {
            return HomePro2Fragment.newInstance();
        }
        return HomePro2Fragment.newInstance();
    }

    @Override
    public int getCount() {
        return 5;
    }

    public static final String[] HOME_PRO_TITLE = {"精选", "读书会", "视频", "文章", "商品"};

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return HOME_PRO_TITLE[position];
    }
}
